package View;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JRadioButton;

import Controller.ViewSwitcher;
import Custom.MouseOver;

@SuppressWarnings("serial")
public class PanelAddTransaction extends JPanel{
	
	private static PanelAddTransaction single;
	
	 JLabel title = new JLabel("Nieuwe transactie :");
	 JLabel fromAccount = new JLabel("Van Rekening : ");
	 JLabel amount = new JLabel("Bedrag : ");
	 JLabel toAccount =  new JLabel("Naar Rekening : ");
	 JLabel description = new JLabel("Omschrijving : ");
	 JLabel period = new JLabel("Periode : ");
	 JLabel currency = new JLabel("\u20ac");

	 JTextField amountField = new JTextField();
	 JTextField descriptionField = new JTextField();
		
	 JButton confirmButton = new JButton("Toevoegen");
	 JButton cancelButton = new JButton("Cancel");
	
	
	public PanelAddTransaction() {
		
		setLayout(null);
		setBounds(140, 0, 860, 725);
		
	    title.setBounds(100, 30, 400, 30);
	    title.setForeground(Color.blue);
	    title.setFont(new Font("Serif", Font.BOLD, 20));
	      
	    final JComboBox fromAccountField = new JComboBox();
	    fromAccountField.addItem("RekeningType 1"
	    		+ "RekeningNaam 1"
	    		+ "RekeningNummer 1");
	    fromAccountField.addItem("RekeningType 2"
	    		+ "RekeningNaam 2"
	    		+ "RekeningNummer 2");
	    fromAccountField.addItem("RekeningType 3"
	    		+ "RekeningNaam 3"
	    		+ "RekeningNummer 3");
	    fromAccountField.addItem("RekeningType 4"
	    		+ "RekeningNaam 4"
	    		+ "RekeningNummer 4");
	    fromAccountField.addItem("RekeningType 5"
	    		+ "RekeningNaam 5"
	    		+ "RekeningNummer 5");
	 	final JComboBox toAccountField = new JComboBox();
	 	toAccountField.addItem("RekeningType 1"
	    		+ "RekeningNaam 1"
	    		+ "RekeningNummer 1");
	 	toAccountField.addItem("RekeningType 2"
	    		+ "RekeningNaam 2"
	    		+ "RekeningNummer 2");
	 	toAccountField.addItem("RekeningType 3"
	    		+ "RekeningNaam 3"
	    		+ "RekeningNummer 3");
	 	toAccountField.addItem("RekeningType 4"
	    		+ "RekeningNaam 4"
	    		+ "RekeningNummer 4");
	 	toAccountField.addItem("RekeningType 5"
	    		+ "RekeningNaam 5"
	    		+ "RekeningNummer 5");
	 	final JComboBox periodField = new JComboBox();
	 	periodField.addItem("Eenmalig");
	 	periodField.addItem("Wekelijks");
	 	periodField.addItem("2 Wekelijks");
	 	periodField.addItem("4 Wekelijks");
	 	periodField.addItem("Maandelijks");
	 	periodField.addItem("2 Maandelijks");
	 	periodField.addItem("Kwartaal");
	 	periodField.addItem("Halfjaarlijks");
	 	periodField.addItem("Jaarlijks");
	      
	      fromAccount.setBounds(80, 70, 200, 30);
	      amount.setBounds(80, 110, 180, 30);
	      currency.setBounds(290, 110, 20, 30);
	      toAccount.setBounds(80, 150, 200, 30);
	      description.setBounds(80, 190, 200, 30);
	      period.setBounds(80, 230, 200, 30);
	      
	      fromAccountField.setBounds(300, 70, 200, 30);
	      amountField.setBounds(300, 110, 200, 30);
	      toAccountField.setBounds(300, 150, 200, 30);
	      descriptionField.setBounds(300, 190, 200, 30);
	      periodField.setBounds(300, 230, 200, 30);
	     
	      confirmButton.setBounds(263, 346, 100, 30);
	    
	      cancelButton.setBounds(400, 346, 100, 30);
	      cancelButton.setActionCommand("TrgnaarRekeningen");
	      cancelButton.addActionListener(new ViewSwitcher());
	      
	      
	      add(title);
	      add(fromAccount);
	      add(amount);
	      add(toAccount);
	      add(description);
	      add(period);
	      add(currency);
	      
	      add(fromAccountField);
	      add(amountField);
	      add(toAccountField);
	      add(descriptionField);
	      add(periodField);
	      
	      add(confirmButton);
	      add(cancelButton);

		
	}

	public static PanelAddTransaction getInstance() {
		if(single == null){
			single = new PanelAddTransaction();
		}
		return single;
	}
	
	public static void selfDestroy(){
		single = null;
	}
}
